package com.blog.controller;

import com.blog.pojo.Feedback;
import com.blog.service.AboutService;
import com.blog.service.impl.AboutServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;

/**

 **/

@Controller
@RestController
public class AboutController {

    @Resource(name = "aboutService")
    private AboutServiceImpl aboutService;

    @RequestMapping("/insertFeedBack")
    public boolean insertFeedBack(String  contact , String content){
        try {
            Feedback feedback = new Feedback();
            Date date = new Date();
            feedback.setTime(date);
            feedback.setContact(contact);
            feedback.setContent(content);
            aboutService.insertFeedBack(feedback);
            return true;
        }catch (Exception e){
            e.printStackTrace();
            return false;
        }
    }
}
